package domain

import (
	"path/filepath"
	"strings"
)

type HotPatchIssue struct {
	Type        string
	Branch      string
	Component   string
	CveNum      []string
	PatchUrl    []string
	HotIssueNum string
}

// SourcePatchName get rpm name of source arch
func (h *HotPatchIssue) SourcePatchName() string {
	for _, v := range h.PatchUrl {
		if strings.Contains(v, "source/Packages") {
			return filepath.Base(v)
		}
	}

	return ""
}
